﻿namespace Vibstudio.X4NET.IO.Path
{
    using System;

    public static class PathExtensions
    {
        public static string FileName(this FilePath filePath, bool isZipped)
        {
            return isZipped ? filePath.ZipFileName : filePath.FileName;
        }

        public static string Path(this FilePath filePath, bool isZipped)
        {
            return isZipped ? filePath.ZipPath : filePath.Path;
        }

        public static string Path(this FilePath filePath, string extension)
        {
            string fileName = string.Format("{0}.{1}", filePath.FileNameWithoutExtension, extension.ToLower());

            return System.IO.Path.Combine(filePath.PathWithoutFile, fileName);
        }
        
        public static string Path(this FilePath filePath, FileType fileType)
        {
            return filePath.Path(Enum.GetName(typeof(FileType), fileType));
        }
    }
}
